package cn.rongdao.jrkabao.model.cashcoupon;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.bean.cashcoupon.SelectCashCouponBean;
import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/8/15
 */

public class SelectCashCouponModel extends BaseKaMaoModel {

    public static SelectCashCouponModel getInstance() {
        return getPresent(SelectCashCouponModel.class);
    }

    public void execute(String passWayId,String amount, Observer<SelectCashCouponBean> observer) {
        addParamStrings("id", FRString.valueOf(passWayId));
        addParamStrings("amount", FRString.valueOf(amount));
        Observable<SelectCashCouponBean> observable = mServletApi.getValidCoupon(mParams).map(new HttpFunction<SelectCashCouponBean>());
        toSubscribe(observable, observer);
    }

}